import request from '../utils/request';

export async function addTodoApi(userid, type, content) {
  return request({
    url: `/todo?userid=${userid}&type=${type}&content=${content}`,
    method: 'GET'
  })
}
export async function delTodoApi(todoId) {
  return request({
    url: `/todo?todoId=${todoId}`,
    method: 'DELETE'
  })
}
export async function getTodoApi(userid, type) {
  return request({
    url: `/todo/list?userid=${userid}&type=${type}`,
    method: 'GET'
  })
}
export async function updateTodoApi(todoId, content) {
  return request({
    url: `/todo?todoId=${todoId}&content=${content}`,
    method: 'PUT'
  })
}
export async function setTodoDefault(userid) {
  return request({
    url: `/todo/default?userid=${userid}`,
    method: 'GET'
  })
}
export async function checkTodoApi(todoId) {
  return request({
    url: `/todo/check?todoId=${todoId}`,
    method: 'GET'
  })
}
